import 'function/point.dart';

var nobleGases = {54: 'xenon'};


int max (a, b) {
  return (a > b) ? a : b;
}

int maxElement (List<num> arguments) {
  var a = arguments;
  var currentMax = arguments.isEmpty ? throw 'Maximal element undefined for empty array' : arguments[0];

  print('currentMax');
  print(currentMax);
  print(a.length);
  for (var i = 0; i < a.length; i++) {
    currentMax = max(a[i], currentMax);
  }
  return currentMax;
}

const defObj = { 'a': true, 'b': false };
somefunc ([Map<String, bool> obj = defObj]) {
  print(obj['a']);
  print(obj['b']);
  print(obj['o']);
}

var map = {};

lookup (key, {ifMissing}) {
  var result = map[key];
  print(result);
  if (result != null) return result;
  return ifMissing == null ? throw "$key not found" : ifMissing();
}

var thing = lookup('anything', ifMissing: () => map['anything'] = 32);
runFunc() {
  runPoint();

  /// nobleGases
  print(nobleGases[54]);

  maxElement([1]);

  somefunc({'a': false, 'b': true, 'o': false});

  print(map);
  print(thing);
}
